<template>
	<view>
		<view class="container" v-for="(item, index) in carData" :key="index" @click="toggleCheckmark(index)" style="width: 100%; float: left;margin-top: 20rpx;padding-bottom: 20rpx; border-bottom: 1rpx solid lightgray;">

			<image src="../../../static/car.jpg"
				style="width: 100rpx;height: 100rpx;float: left; margin-left: 20rpx; border-radius: 50%;"></image>
			<view style="  margin-left: 40px; float:left;">
				<view>车型: {{item.model}}</view>
				<view>车牌: {{item.licensePlate}}</view>
			</view>

			<image v-if="checkedIndex === index" src="../../../static/duihao.png"
				style="width: 60rpx;height: 60rpx;float: right; margin-right: 20px; ">
			</image>


		</view>
		

	</view>
</template>

<script>
	export default {
		data() {
			return {
				carData: [{
						model: '介驰-GR',
						licensePlate: '豫M34523'
					},
					{
						model: '介驰-GR',
						licensePlate: '豫M34523'
					},
				],
				checkedIndex: 0,
			}
		},
		methods: {
			toggleCheckmark(index) {
				this.checkedIndex = index;
			},
		}
	}
</script>

<style>

</style>